package device

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type DeviceRouter struct{}

func (s *DeviceRouter) InitDeviceRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	DevRouter := Router.Group("Dev").Use(middleware.OperationRecord())
	DevRouterWithoutRecord := Router.Group("Dev")
	DevRouterWithoutAuth := PublicRouter.Group("Dev")
	{
		DevRouter.POST("createDevice", DevApi.CreateDevice)
		DevRouter.DELETE("deleteDevice", DevApi.DeleteDevice)
		DevRouter.DELETE("deleteDeviceByIds", DevApi.DeleteDeviceByIds)
		DevRouter.PUT("updateDevice", DevApi.UpdateDevice)
		DevRouter.GET("deviceDashboard", DevApi.DeviceDashboard)
	}
	{
		DevRouterWithoutRecord.GET("findDevice", DevApi.FindDevice)
		DevRouterWithoutRecord.GET("getDeviceList", DevApi.GetDeviceList)
	}
	{
		DevRouterWithoutAuth.GET("getDevicePublic", DevApi.GetDevicePublic)
	}
}
